package de.szut.gui.options;

import de.szut.gui.language.TranslatableRadioButton;

public class OptionsRadioButton extends TranslatableRadioButton implements OptionsComponent {

	private static final long serialVersionUID = 8308725464001776364L;
	private String key;
	
	@Override
	public String getOptionComponentState() {
		if (isSelected()) {
			return "1";
		}
		return "0";
	}

	@Override
	public void setOptionComponentState(String newState) {
		if (newState.equals("1")) {
			setSelected(true);
		} else if (newState.equals("0")) {
			setSelected(false);
		}
	}

	@Override
	public String getOptionKey() {
		return key;
	}

	@Override
	public void setOptionKey(String key) {
		this.key = key;
	}
}
